package com.running.util;

import org.springframework.context.support.AbstractApplicationContext;

public class CrmContext {
	private  static final String [] contextFile = {"config/spring/common-context.xml","config/spring/rbac_context.xml","config/spring/crm_context.xml","config/spring/dispatcher-servlet.xml"};
	private static AbstractApplicationContext applicationContext;
	public static Object getBean(String beanName){
		return getApplicationContenxt().getBean(beanName);
	}
	
	private static AbstractApplicationContext getApplicationContenxt(){
		if(null == applicationContext){			
			applicationContext = AppContext.getAppContext(contextFile);
		}
		return applicationContext;
	}
}
